<template>
  <!--    头部组件-->
    <view class="wechat-header">
        <view class="header-left">
            <slot name="left"></slot>
        </view>
        <h1 class="header-title">
            <slot name="title">{{ props.title }}</slot>
        </h1>
        <view class="header-right">
            <slot name="right"></slot>
        </view>
    </view>
</template>
<script setup lang="ts">
import {defineProps} from 'vue'

const props = defineProps<{
    title?: string
}>()
</script>
<style scoped>
.wechat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f8f8;
    padding: 16px;
    box-sizing: border-box;
    position: relative;
}

.header-left, .header-right {
    flex-shrink: 0;
}

.header-title {
    font-size: 18px;
    color: #333;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
</style>

